#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include "System.h"
#include <QMainWindow>
#include <QPainter>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWidget; }
QT_END_NAMESPACE

class MainWidget : public QMainWindow
{
    Q_OBJECT

public:
    System* sys;

    MainWidget(System* sys, QWidget *parent = nullptr);
    ~MainWidget();

    void flushTable();
    void flushWidget();
    void initUi();

private slots:
    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

private:
    QSqlTableModel *model;
    Ui::MainWidget *ui;

    void initModel();

protected:
    void paintEvent(QPaintEvent *event) override
    {
        QPainter painter(this);
        painter.drawPixmap(rect(),QPixmap(":/3.png"),QRect());
    }
};
#endif // MAINWIDGET_H
